<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <title>传智健康</title>
    <meta content="传智健康" name="description">
    <meta content="传智健康" name="keywords">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <script src="../js/vue.js"></script>
    <link href="../css/style.css" rel="stylesheet" type="text/css">
    <script src="../plugins/echarts/echarts.js"></script>
    <script src="../js/axios-0.18.0.js"></script>
    <link href="../plugins/elementui/lib/theme-chalk/index.css" rel="stylesheet">
    <script src="../plugins/elementui/lib/index.js"></script>

</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>统计分析
            <small>体检收入统计</small>

        </h1>
        <el-breadcrumb class="breadcrumb" separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>统计分析</el-breadcrumb-item>
            <el-breadcrumb-item>体检收入统计</el-breadcrumb-item>
        </el-breadcrumb>
    </div>

    <div class="block">
        <span class="demonstration"></span>
        <el-date-picker
                :picker-options="picker"
                @change="picker(

                )"
                end-placeholder="结束日期"
                range-separator="至"
                start-placeholder="开始日期"
                type="datetimerange"
                v-model="value1">
        </el-date-picker>
    </div>

    <div class="box">
        <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
        <div id="chart1" style="height:600px;"></div>
    </div>

</div>
</body>
<!-- 引入组件库 -->
<script type="text/javascript">
    new Vue({
        el: "#app",
        data: {
            value1: []
        },

        methods: {


            picker() {
                axios.post("/report/getMoney.do", this.value1).then((res) => {

                    // 基于准备好的dom，初始化echarts实例
                    var myChart1 = echarts.init(document.getElementById('chart1'));
                    //发送ajax请求获取动态数据
                    myChart1.setOption({

                            tooltip: {
                                trigger: 'item',
                                formatter: '{a} <br/>{b}: {c} ({d}%)'
                            },
                            legend: {
                                orient: 'vertical',
                                left: 10,
                                data: ['入职无忧体检套餐（男女通用）', '粉红珍爱(女)升级TM12项筛查体检套餐', '阳光爸妈升级肿瘤12项筛查（男女单人）体检套餐',
                                    '珍爱高端升级肿瘤12项筛查（男女单人）', '总收入']
                            },

                            series: [
                                {
                                    name: '访问来源',
                                    type: 'pie',
                                    radius: ['50%', '70%'],
                                    avoidLabelOverlap: false,
                                    label: {
                                        show: false,
                                        position: 'center'
                                    },
                                    emphasis: {
                                        label: {
                                            show: true,
                                            fontSize: '30',
                                            fontWeight: 'bold'
                                        }
                                    },
                                    labelLine: {
                                        show: false
                                    },
                                    data: res.data.data

                                }
                            ]
                        }
                    )

                })
            }

        }
    });

</script>
</html>
